<template>
  <div>
    <el-row :gutter="20" class="gl_pb_10">
      <el-col :span="24">
        当前选定单位：
        <span>{{ $route.query.disname ? $route.query.disname + '-' : '' }}</span>
        <span>{{ $route.query.currentTreeData ? $route.query.currentTreeData : '' }}</span>
      </el-col>
    </el-row>
    <el-tabs v-model="activeName">
      <template v-for="item in optList">
        <el-tab-pane :key="item.code" :name="item.code" :label="item.name" />
      </template>
    </el-tabs>
    <game-list v-if="activeName === 'GameManage'" />
    <league-list v-if="activeName === 'League'" />
  </div>
</template>
<script>
import gameList from './components/gameList';
import leagueList from './components/leagueList';
import { mapState } from 'vuex';
export default {
  components: {
    gameList,
    leagueList
  },
  data() {
    return {
      activeName: '',
      optList: [
        {
          code: 'GameManage',
          name: '独立赛',
          component: gameList
        },
        {
          code: 'League',
          name: '联赛',
          component: leagueList
        }
      ]
    };
  },
  computed: {
    ...mapState({
      tenantId: state => state.user.tenantId
    })
  },
  created() {
    this.activeName = this.$route.query.gameType || 'GameManage';
  },
  methods: {
  }
};
</script>
